// https://github.com/antfu/eslint-config?tab=readme-ov-file
// https://typescript-eslint.io/rules/consistent-type-imports/
import antfu from '@antfu/eslint-config'

export default antfu({
  // Type of the project. 'lib' for libraries, the default is 'app'
  type: 'app',

  // Enable stylistic formatting rules
  // stylistic: true,

  // Or customize the stylistic rules
  stylistic: {
    indent: 2, // 4, or 'tab'
    quotes: 'single', // or 'double'
    printWidth: 10,
  },

  // TypeScript and Vue are autodetected, you can also explicitly enable them:
  typescript: true,
  vue: true,

  // Disable jsonc and yaml support
  jsonc: false,
  yaml: false,

  // `.eslintignore` is no longer supported in Flat config, use `ignores` instead
  ignores: [
    '**/fixtures',
    '*.md',
    // ...globs
  ],

  rules: {
    'n/prefer-global/process': 'off',
    '@typescript-eslint/consistent-type-imports': 'off',
    '@typescript-eslint/explicit-function-return-type': 'off',
    // 不需要表明是 Node.js 内置模块->node:fs
    'unicorn/prefer-node-protocol': 'off',
    'no-console': 'off',
    'dot-notation': 'off',
    'node/no-path-concat': 'off',
    'ts/no-require-imports': 'off',
    'unused-imports/no-unused-vars': 'warn',
  },
})
